package com.dmbjz.openApi.controller;


import com.dmbjz.openApi.entity.Person;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.Parameter;
import io.swagger.v3.oas.annotations.Parameters;
import io.swagger.v3.oas.annotations.tags.Tag;
import org.springframework.web.bind.annotation.*;

@Tag(name = "人员管理", description = "对人员进行操作")
@RestController
@RequestMapping("/person")
public class PersonController {


    @Operation(summary = "获取人员", description = "get操作")
    @GetMapping("get")
    public String getName(@Parameter(description = "姓名") String name,
                          @Parameter(description = "年龄") String age) {
        return "dmbjz";
    }


    @Parameters({
            @Parameter(
                    name = "name",
                    description = "姓名"
            ),
            @Parameter(
                    name = "age",
                    description = "年龄"
            )
    })
    @Operation(summary = "更新人员", description = "update操作")
    @PutMapping("update")
    public String updatePerson(String name, String age) {
        return "更新成功";
    }


    @Operation(summary = "添加人员", description = "add操作")
    @GetMapping("addPerson")
    public String addPerson(Person person) {
        return "添加成功";
    }

    @DeleteMapping("delete")
    public String delete() {
        return "删除成功";
    }

}
